topic "Ultimate++ vs Qt";
[l288;i704;a17;O9;~~~.992; $$1,0#10431211400427159095818037425705:param]
[a83;*R6 $$2,5#31310162474203024125188417583966:caption]
[b83;* $$3,5#07864147445237544204411237157677:title]
[b167;a42;C $$4,6#40027414424643823182269349404212:item]
[b42;a42;pht300; $$5,5#45413000475342174754091244180557:text]
[l288;a17; $$6,6#27521748481378242620020725143825:desc]
[l321;t246;C@5;1 $$7,7#20902679421464641399138805415013:code]
[b2503; $$8,0#65142375456100023862071332075487:separator]
[*@(0.0.255) $$9,0#83433469410354161042741608181528:base]
[t4167;C+117 $$10,0#37138531426314131251341829483380:class]
[l288;a17;*1 $$11,11#70004532496200323422659154056402:requirement]
[i416;b42;a42;O9;~~~.416; $$12,12#10566046415157235020018451313112:tparam]
[b167;C $$13,13#92430459443460461911108080531343:item1]
[a42;C $$14,14#77422149456609303542238260500223:item2]
[*@2$(0.128.128) $$15,15#34511555403152284025741354420178:NewsDate]
[l321;*C$7 $$16,16#03451589433145915344929335295360:result]
[l321;b83;a83;*C$7 $$17,17#07531550463529505371228428965313:result`-line]
[l160;t4167;*C+117 $$18,5#88603949442205825958800053222425:package`-title]
[ $$0,0#00000000000000000000000000000000:Default]
[{_}%EN-US 
[s2; U`+`+ vs Qt [5 (R)]&]
[s5; To compare U`+`+ with Qt (R), we decided to reimplement Qt demonstration 
example `"AddressBook`". On the left side is U`+`+ code, on the 
right side original Qt example.f&]
[s0;/2 &]
[s0; [/0 Qt and the Qt logo are trademarks of Trolltech in Norway, 
the United States and other countries.]&]
[s0;2 &]
[s0;= [2 
@@image:1778&1704
(A/YB4QEAAB/+AAAAAHic7d0vmNvYvcbxgRcuXLhgwYIFAQULCgIKFlwQcEFAwYKCgIKAgoCCARcEFAQEBBQsWBBQsKAgoCDgggEXGCwIKChcWBhwwbXHtqw/R8eSbFnST5/v8z7nUWTN2H4lf33mzGRms3nYiIhIuDx9+nQ7fv6/zyIiEin39/eF4Sd/rxERkSumZvj/+PrFF9+8TIzf7M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I6GfyinuHX/Y/Dl/QwPAEthb/jNLw+13B/1XtvJ8ACwFA6Gb/dw08kMDwCLgOEBICoMDwBRYXgAiMrW8L2OZ3gAWAp3/bmi4Tt+7SAiIjfLVQzf/ffSi4jILXO54UVEZHFheBGRqGF4EZGoYXgRkahheBGRqGF4EZGoYXgRkahheBGRqGF4EZGoKQw/ye9hAACMylMAQFz+H67tOcI=)
]&]
[s0;=2 &]
[ {{5000:5000^@7 [s0; [*2 Ultimate`+`+ version]]
:: [s0; [*2 Qt version]]
::@2 [s0; [*C2 AddressBook.cpp]&]
[s0;C0 &]
[s0; [C0 #include <TCtrlLib/TCtrlLib.h>]&]
[s0;C0 &]
[s0; [C0 #define LAYOUTFILE <AddressBook/AddressBook.lay>]&]
[s0; [C0 #include <CtrlCore/lay.h>]&]
[s0;C0 &]
[s0; [C0 class AddressBook : public WithAddressBookLayout<TopWindow> 
`{]&]
[s0; [C0 -|WithModifyLayout<StaticRect> modify;]&]
[s0; [C0 -|WithSearchLayout<StaticRect> search;]&]
[s0; [C0 -|FileSel fs;]&]
[s0; [C0 -|String  filename;]&]
[s0; [C0 -|]&]
[s0; [C0 -|void SetupSearch();]&]
[s0; [C0 -|void Add();]&]
[s0; [C0 -|void Change();]&]
[s0; [C0 -|void Search();]&]
[s0; [C0 -|void Open();]&]
[s0; [C0 -|void Save();]&]
[s0; [C0 -|void SaveAs();]&]
[s0; [C0 -|void Print();]&]
[s0; [C0 -|void Quit();]&]
[s0; [C0 -|void FileMenu(Bar`& bar);]&]
[s0; [C0 -|void MainMenu(Bar`& bar);]&]
[s0;C0 &]
[s0; [C0 -|typedef AddressBook CLASSNAME;]&]
[s0;C0 &]
[s0; [C0 public:]&]
[s0; [C0 -|void Serialize(Stream`& s);]&]
[s0;C0 &]
[s0; [C0 -|AddressBook();]&]
[s0; [C0 `};]&]
[s0;C0 &]
[s0; [C0 AddressBook`::AddressBook()]&]
[s0; [C0 `{]&]
[s0; [C0 -|CtrlLayout(`*this, `"Address book`");]&]
[s0; [C0 -|CtrlLayout(modify);]&]
[s0; [C0 -|CtrlLayout(search);]&]
[s0; [C0 -|tab.Add(modify, `"Modify`");]&]
[s0; [C0 -|tab.Add(search, `"Search`");]&]
[s0; [C0 -|ActiveFocus(search.name);]&]
[s0; [C0 -|search.oname `= true;]&]
[s0; [C0 -|search.oname <<`= search.osurname <<`= search.oaddress]&]
[s0; [C0 -|             <<`= search.oemail <<`= THISBACK(SetupSearch);]&]
[s0; [C0 -|array.AddColumn(`"Name`");]&]
[s0; [C0 -|array.AddColumn(`"Surname`");]&]
[s0; [C0 -|array.AddColumn(`"Address`");]&]
[s0; [C0 -|array.AddColumn(`"Email`");]&]
[s0; [C0 -|modify.add <<`= THISBACK(Add);]&]
[s0; [C0 -|modify.change <<`= THISBACK(Change);]&]
[s0; [C0 -|search.search <<`= THISBACK(Search);]&]
[s0; [C0 -|SetupSearch();]&]
[s0; [C0 -|fs.AllFilesType();]&]
[s0; [C0 -|menu.Set(THISBACK(MainMenu));]&]
[s0; [C0 `}]&]
[s0;C0 &]
[s0; [C0 void AddressBook`::FileMenu(Bar`& bar)]&]
[s0; [C0 `{]&]
[s0; [C0 -|bar.Add(`"Open..`", CtrlImg`::open(), THISBACK(Open));]&]
[s0; [C0 -|bar.Add(`"Save`", CtrlImg`::save(), THISBACK(Save));]&]
[s0; [C0 -|bar.Add(`"Save as..`", CtrlImg`::save`_as(), THISBACK(SaveAs));]&]
[s0; [C0 -|bar.Separator();]&]
[s0; [C0 -|bar.Add(`"Print`", CtrlImg`::print(), THISBACK(Print));]&]
[s0; [C0 -|bar.Separator();]&]
[s0; [C0 -|bar.Add(`"Quit`", THISBACK(Quit));]&]
[s0; [C0 `}]&]
[s0;C0 &]
[s0; [C0 void AddressBook`::MainMenu(Bar`& bar)]&]
[s0; [C0 `{]&]
[s0; [C0 -|bar.Add(`"File`", THISBACK(FileMenu));]&]
[s0; [C0 `}]&]
[s0;C0 &]
[s0; [C0 void AddressBook`::SetupSearch()]&]
[s0; [C0 `{]&]
[s0; [C0 -|search.name.Enable(search.oname);]&]
[s0; [C0 -|search.surname.Enable(search.osurname);]&]
[s0; [C0 -|search.address.Enable(search.oaddress);]&]
[s0; [C0 -|search.email.Enable(search.oemail);]&]
[s0; [C0 `}]&]
[s0;C0 &]
[s0; [C0 void AddressBook`::Add()]&]
[s0; [C0 `{]&]
[s0; [C0 -|array.Add(`~modify.name, `~modify.surname, `~modify.address, 
`~modify.email);]&]
[s0; [C0 -|array.GoEnd();]&]
[s0; [C0 -|modify.name <<`= modify.surname <<`= modify.address <<`= 
modify.email <<`= Null;]&]
[s0; [C0 -|ActiveFocus(modify.name);]&]
[s0; [C0 `}]&]
[s0;C0 &]
[s0; [C0 void AddressBook`::Change()]&]
[s0; [C0 `{]&]
[s0; [C0 -|if(array.IsCursor()) `{]&]
[s0; [C0 -|-|array.Set(0, `~modify.name);]&]
[s0; [C0 -|-|array.Set(1, `~modify.surname);]&]
[s0; [C0 -|-|array.Set(2, `~modify.address);]&]
[s0; [C0 -|-|array.Set(3, `~modify.email);]&]
[s0; [C0 -|`}]&]
[s0; [C0 `}]&]
[s0;C0 &]
[s0; [C0 bool Contains(const String`& text, const String`& substr)]&]
[s0; [C0 `{]&]
[s0; [C0 -|for(const char `*s `= text; s <`= text.End() `- substr.GetLength(); 
s`+`+)]&]
[s0; [C0 -|-|if(strncmp(s, substr, substr.GetLength()) `=`= 0)]&]
[s0; [C0 -|-|-|return true;]&]
[s0; [C0 -|return false;]&]
[s0; [C0 `}]&]
[s0;C0 &]
[s0; [C0 void AddressBook`::Search()]&]
[s0; [C0 `{]&]
[s0; [C0 -|if(!array.GetCount()) return;]&]
[s0; [C0 -|bool sc `= true;]&]
[s0; [C0 -|array.ClearSelection();]&]
[s0; [C0 -|for(int i `= 0; i < array.GetCount(); i`+`+) `{]&]
[s0; [C0 -|-|if((!search.oname `|`| Contains(array.Get(i, 0), `~search.name)) 
`&`&]&]
[s0; [C0 -|-|   (!search.osurname `|`| Contains(array.Get(i, 1), `~search.surname)) 
`&`&]&]
[s0; [C0 -|-|   (!search.oaddress `|`| Contains(array.Get(i, 2), `~search.address)) 
`&`&]&]
[s0; [C0 -|-|   (!search.oemail `|`| Contains(array.Get(i, 3), `~search.email))) 
`{]&]
[s0; [C0 -|-|-|array.Select(i);]&]
[s0; [C0 -|-|-|if(sc) `{]&]
[s0; [C0 -|-|-|-|array.SetCursor(i);]&]
[s0; [C0 -|-|-|-|array.CenterCursor();]&]
[s0; [C0 -|-|-|-|sc `= false;]&]
[s0; [C0 -|-|-|`};]&]
[s0; [C0 -|-|`}]&]
[s0; [C0 -|`}]&]
[s0; [C0 `}]&]
[s0;C0 &]
[s0; [C0 void AddressBook`::Open()]&]
[s0; [C0 `{]&]
[s0; [C0 -|if(!fs.ExecuteOpen()) return;]&]
[s0; [C0 -|filename `= fs;]&]
[s0; [C0 -|FileIn in(filename);]&]
[s0; [C0 -|if(!in) `{]&]
[s0; [C0 -|-|Exclamation(`"Unable to open `" `+ filename);]&]
[s0; [C0 -|-|return;]&]
[s0; [C0 -|`}]&]
[s0; [C0 -|array.Clear();]&]
[s0; [C0 -|while(!in.IsEof()) `{]&]
[s0; [C0 -|-|Vector<Value> q;]&]
[s0; [C0 -|-|for(int i `= 0; i < 4; i`+`+)]&]
[s0; [C0 -|-|-|q.Add(in.GetLine());]&]
[s0; [C0 -|-|array.Add(q);]&]
[s0; [C0 -|`}]&]
[s0; [C0 `}]&]
[s0;C0 &]
[s0; [C0 void AddressBook`::Save()]&]
[s0; [C0 `{]&]
[s0; [C0 -|if(IsEmpty(filename)) `{]&]
[s0; [C0 -|-|SaveAs();]&]
[s0; [C0 -|-|return;]&]
[s0; [C0 -|`}]&]
[s0; [C0 -|FileOut out(filename);]&]
[s0; [C0 -|if(!out) `{]&]
[s0; [C0 -|-|Exclamation(`"Unable to open `" `+ filename);]&]
[s0; [C0 -|-|return;]&]
[s0; [C0 -|`}]&]
[s0; [C0 -|for(int i `= 0; i < array.GetCount(); i`+`+) `{]&]
[s0; [C0 -|-|for(int q `= 0; q < 4; i`+`+)]&]
[s0; [C0 -|-|-|out.PutLine(String(array.Get(i, q)));]&]
[s0; [C0 -|`}]&]
[s0; [C0 `}]&]
[s0;C0 &]
[s0; [C0 void AddressBook`::SaveAs()]&]
[s0; [C0 `{]&]
[s0; [C0 -|if(!fs.ExecuteSaveAs()) return;]&]
[s0; [C0 -|filename `= fs;]&]
[s0; [C0 -|Save();]&]
[s0; [C0 `}]&]
[s0;C0 &]
[s0; [C0 void AddressBook`::Print()]&]
[s0; [C0 `{]&]
[s0; [C0 -|String qtf;]&]
[s0; [C0 -|qtf `= `"`+`+Name`|`|Surname`|`|Address`|`|Email`";]&]
[s0; [C0 -|for(int i `= 0; i < array.GetCount(); i`+`+) `{]&]
[s0; [C0 -|-|qtf << `"`-`-`";]&]
[s0; [C0 -|-|for(int q `= 0; q < 4; q`+`+) `{]&]
[s0; [C0 -|-|-|if(q) qtf << `"`|`|`";]&]
[s0; [C0 -|-|-|qtf << DeQtf((String)array.Get(i, q));]&]
[s0; [C0 -|-|`}]&]
[s0; [C0 -|`}]&]
[s0; [C0 -|qtf << `"`+`+`";]&]
[s0; [C0 -|Report report;]&]
[s0; [C0 -|report << qtf;]&]
[s0; [C0 -|report.Perform();]&]
[s0; [C0 `}]&]
[s0;C0 &]
[s0; [C0 void AddressBook`::Quit()]&]
[s0; [C0 `{]&]
[s0; [C0 -|Break();]&]
[s0; [C0 `}]&]
[s0;C0 &]
[s0; [C0 void AddressBook`::Serialize(Stream`& s)]&]
[s0; [C0 `{]&]
[s0; [C0 -|int version `= 0;]&]
[s0; [C0 -|s / version;]&]
[s0; [C0 -|s % search.oname % search.osurname % search.oaddress % search.oemail;]&]
[s0; [C0 -|s % fs;]&]
[s0; [C0 -|SetupSearch();]&]
[s0; [C0 `}]&]
[s0;C0 &]
[s0; [C0 GUI`_APP`_MAIN]&]
[s0; [C0 `{]&]
[s0; [C0 -|AddressBook ab;]&]
[s0; [C0 -|LoadFromFile(ab);]&]
[s0; [C0 -|ab.Run();]&]
[s0; [C0 -|StoreToFile(ab);]&]
[s0; [C0 `}]&]
[s0;C0 ]
:: [s0; [*C2 mainwindow.h]&]
[s0;C0 &]
[s0; [C0 #ifndef AB`_MAINWINDOW`_H]&]
[s0; [C0 #define AB`_MAINWINDOW`_H]&]
[s0;C0 &]
[s0; [C0 #include <qmainwindow.h>]&]
[s0; [C0 #include <qstring.h>]&]
[s0;C0 &]
[s0; [C0 class QToolBar;]&]
[s0; [C0 class QPopupMenu;]&]
[s0; [C0 class ABCentralWidget;]&]
[s0;C0 &]
[s0; [C0 class ABMainWindow: public QMainWindow]&]
[s0; [C0 `{]&]
[s0; [C0     Q`_OBJECT]&]
[s0;C0 &]
[s0; [C0 public:]&]
[s0; [C0     ABMainWindow();]&]
[s0; [C0     `~ABMainWindow();]&]
[s0;C0 &]
[s0; [C0 protected slots:]&]
[s0; [C0     void fileNew();]&]
[s0; [C0     void fileOpen();]&]
[s0; [C0     void fileSave();]&]
[s0; [C0     void fileSaveAs();]&]
[s0; [C0     void filePrint();]&]
[s0; [C0     void closeWindow();]&]
[s0;C0 &]
[s0; [C0 protected:]&]
[s0; [C0     void setupMenuBar();]&]
[s0; [C0     void setupFileTools();]&]
[s0; [C0     void setupStatusBar();]&]
[s0; [C0     void setupCentralWidget();]&]
[s0;C0 &]
[s0; [C0     QToolBar `*fileTools;]&]
[s0; [C0     QString filename;]&]
[s0; [C0     ABCentralWidget `*view;]&]
[s0;C0 &]
[s0; [C0 `};]&]
[s0;C0 &]
[s0;C0 &]
[s0; [C0 #endif]&]
[s0;C0 &]
[s0; [*C2 mainwindow.cpp]&]
[s0;C0 &]
[s0; [C0 #include `"mainwindow.h`"]&]
[s0; [C0 #include `"centralwidget.h`"]&]
[s0;C0 &]
[s0; [C0 #include <qtoolbar.h>]&]
[s0; [C0 #include <qtoolbutton.h>]&]
[s0; [C0 #include <qpopupmenu.h>]&]
[s0; [C0 #include <qmenubar.h>]&]
[s0; [C0 #include <qstatusbar.h>]&]
[s0; [C0 #include <qapplication.h>]&]
[s0; [C0 #include <qfiledialog.h>]&]
[s0;C0 &]
[s0; [C0 ABMainWindow`::ABMainWindow()]&]
[s0; [C0     : QMainWindow( 0, `"example addressbook application`" ),]&]
[s0; [C0       filename( QString`::null )]&]
[s0; [C0 `{]&]
[s0; [C0     setupMenuBar();]&]
[s0; [C0     setupFileTools();]&]
[s0; [C0     setupStatusBar();]&]
[s0; [C0     setupCentralWidget();]&]
[s0; [C0 `}]&]
[s0;C0 &]
[s0;C0 &]
[s0; [C0 ABMainWindow`::`~ABMainWindow()]&]
[s0; [C0 `{]&]
[s0; [C0 `}]&]
[s0;C0 &]
[s0; [C0 void ABMainWindow`::setupMenuBar()]&]
[s0; [C0 `{]&]
[s0; [C0     QPopupMenu `*file `= new QPopupMenu( this );]&]
[s0; [C0     menuBar()`->insertItem( `"`&File`", file );]&]
[s0;C0 &]
[s0; [C0     file`->insertItem( `"New`", this, SLOT( fileNew() ), CTRL 
`+ Key`_N );]&]
[s0; [C0     file`->insertItem( QPixmap( `"fileopen.xpm`" ), `"Open`", 
this, SLOT( fileOpen() ), CTRL `+ Key`_O );]&]
[s0; [C0     file`->insertSeparator();]&]
[s0; [C0     file`->insertItem( QPixmap( `"filesave.xpm`" ), `"Save`", 
this, SLOT( fileSave() ), CTRL `+ Key`_S );]&]
[s0; [C0     file`->insertItem( `"Save As...`", this, SLOT( fileSaveAs() 
) );]&]
[s0; [C0     file`->insertSeparator();]&]
[s0; [C0     file`->insertItem( QPixmap( `"fileprint.xpm`" ), `"Print...`", 
this, SLOT( filePrint() ), CTRL `+ Key`_P );]&]
[s0; [C0     file`->insertSeparator();]&]
[s0; [C0     file`->insertItem( `"Close`", this, SLOT( closeWindow() 
), CTRL `+ Key`_W );]&]
[s0; [C0     file`->insertItem( `"Quit`", qApp, SLOT( quit() ), CTRL 
`+ Key`_Q );]&]
[s0; [C0 `}]&]
[s0;C0 &]
[s0; [C0 void ABMainWindow`::setupFileTools()]&]
[s0; [C0 `{]&]
[s0; [C0     //fileTools `= new QToolBar( this, `"file operations`" 
);]&]
[s0; [C0 `}]&]
[s0;C0 &]
[s0; [C0 void ABMainWindow`::setupStatusBar()]&]
[s0; [C0 `{]&]
[s0; [C0     //statusBar()`->message( `"Ready`", 2000 );]&]
[s0; [C0 `}]&]
[s0;C0 &]
[s0; [C0 void ABMainWindow`::setupCentralWidget()]&]
[s0; [C0 `{]&]
[s0; [C0     view `= new ABCentralWidget( this );]&]
[s0; [C0     setCentralWidget( view );]&]
[s0; [C0 `}]&]
[s0;C0 &]
[s0; [C0 void ABMainWindow`::closeWindow()]&]
[s0; [C0 `{]&]
[s0; [C0     close();]&]
[s0; [C0 `}]&]
[s0;C0 &]
[s0; [C0 void ABMainWindow`::fileNew()]&]
[s0; [C0 `{]&]
[s0; [C0 `}]&]
[s0;C0 &]
[s0; [C0 void ABMainWindow`::fileOpen()]&]
[s0; [C0 `{]&]
[s0; [C0     QString fn `= QFileDialog`::getOpenFileName( QString`::null, 
QString`::null, this );]&]
[s0; [C0     if ( !fn.isEmpty() ) `{]&]
[s0; [C0         filename `= fn;]&]
[s0; [C0         view`->load( filename );]&]
[s0; [C0     `}]&]
[s0; [C0 `}]&]
[s0;C0 &]
[s0; [C0 void ABMainWindow`::fileSave()]&]
[s0; [C0 `{]&]
[s0; [C0     if ( filename.isEmpty() ) `{]&]
[s0; [C0         fileSaveAs();]&]
[s0; [C0         return;]&]
[s0; [C0     `}]&]
[s0;C0 &]
[s0; [C0     view`->save( filename );]&]
[s0; [C0 `}]&]
[s0;C0 &]
[s0; [C0 void ABMainWindow`::fileSaveAs()]&]
[s0; [C0 `{]&]
[s0; [C0     QString fn `= QFileDialog`::getSaveFileName( QString`::null, 
QString`::null, this );]&]
[s0; [C0     if ( !fn.isEmpty() ) `{]&]
[s0; [C0         filename `= fn;]&]
[s0; [C0         fileSave();]&]
[s0; [C0     `}]&]
[s0; [C0 `}]&]
[s0;C0 &]
[s0; [C0 void ABMainWindow`::filePrint()]&]
[s0; [C0 `{]&]
[s0; [C0 `}]&]
[s0;C0 &]
[s0; [*C2 centralwidget.h]&]
[s0;C0 &]
[s0; [C0 #ifndef AB`_CENTRALWIDGET`_H]&]
[s0; [C0 #define AB`_CENTRALWIDGET`_H]&]
[s0;C0 &]
[s0; [C0 #include <qwidget.h>]&]
[s0; [C0 #include <qstring.h>]&]
[s0;C0 &]
[s0; [C0 class QTabWidget;]&]
[s0; [C0 class QListView;]&]
[s0; [C0 class QGridLayout;]&]
[s0; [C0 class QLineEdit;]&]
[s0; [C0 class QPushButton;]&]
[s0; [C0 class QListViewItem;]&]
[s0; [C0 class QCheckBox;]&]
[s0;C0 &]
[s0; [C0 class ABCentralWidget : public QWidget]&]
[s0; [C0 `{]&]
[s0; [C0     Q`_OBJECT]&]
[s0;C0 &]
[s0; [C0 public:]&]
[s0; [C0     ABCentralWidget( QWidget `*parent, const char `*name `= 
0 );]&]
[s0;C0 &]
[s0; [C0     void save( const QString `&filename );]&]
[s0; [C0     void load( const QString `&filename );]&]
[s0;C0 &]
[s0; [C0 protected slots:]&]
[s0; [C0     void addEntry();]&]
[s0; [C0     void changeEntry();]&]
[s0; [C0     void itemSelected( QListViewItem`* );]&]
[s0; [C0     void selectionChanged();]&]
[s0; [C0     void toggleFirstName();]&]
[s0; [C0     void toggleLastName();]&]
[s0; [C0     void toggleAddress();]&]
[s0; [C0     void toggleEMail();]&]
[s0; [C0     void findEntries();]&]
[s0;C0 &]
[s0; [C0 protected:]&]
[s0; [C0     void setupTabWidget();]&]
[s0; [C0     void setupListView();]&]
[s0;C0 &]
[s0; [C0     QGridLayout `*mainGrid;]&]
[s0; [C0     QTabWidget `*tabWidget;]&]
[s0; [C0     QListView `*listView;]&]
[s0; [C0     QPushButton `*add, `*change, `*find;]&]
[s0; [C0     QLineEdit `*iFirstName, `*iLastName, `*iAddress, `*iEMail,]&]
[s0; [C0         `*sFirstName, `*sLastName, `*sAddress, `*sEMail;]&]
[s0; [C0     QCheckBox `*cFirstName, `*cLastName, `*cAddress, `*cEMail;]&]
[s0;C0 &]
[s0; [C0 `};]&]
[s0;C0 &]
[s0; [C0 #endif]&]
[s0;C0 &]
[s0; [*C2 centralwidget.cpp]&]
[s0;C0 &]
[s0; [C0 #include `"centralwidget.h`"]&]
[s0;C0 &]
[s0; [C0 #include <qtabwidget.h>]&]
[s0; [C0 #include <qlistview.h>]&]
[s0; [C0 #include <qlayout.h>]&]
[s0; [C0 #include <qwidget.h>]&]
[s0; [C0 #include <qlabel.h>]&]
[s0; [C0 #include <qpushbutton.h>]&]
[s0; [C0 #include <qlineedit.h>]&]
[s0; [C0 #include <qlabel.h>]&]
[s0; [C0 #include <qcheckbox.h>]&]
[s0; [C0 #include <qfile.h>]&]
[s0; [C0 #include <qtextstream.h>]&]
[s0;C0 &]
[s0; [C0 ABCentralWidget`::ABCentralWidget( QWidget `*parent, const 
char `*name )]&]
[s0; [C0     : QWidget( parent, name )]&]
[s0; [C0 `{]&]
[s0; [C0     mainGrid `= new QGridLayout( this, 2, 1, 5, 5 );]&]
[s0;C0 &]
[s0; [C0     setupTabWidget();]&]
[s0; [C0     setupListView();]&]
[s0;C0 &]
[s0; [C0     mainGrid`->setRowStretch( 0, 0 );]&]
[s0; [C0     mainGrid`->setRowStretch( 1, 1 );]&]
[s0; [C0 `}]&]
[s0;C0 &]
[s0; [C0 void ABCentralWidget`::setupListView()]&]
[s0; [C0 `{]&]
[s0; [C0     listView `= new QListView( this );]&]
[s0; [C0     listView`->addColumn( `"First Name`" );]&]
[s0; [C0     listView`->addColumn( `"Last Name`" );]&]
[s0; [C0     listView`->addColumn( `"Address`" );]&]
[s0; [C0     listView`->addColumn( `"E`-Mail`" );]&]
[s0;C0 &]
[s0; [C0     listView`->setSelectionMode( QListView`::Single );]&]
[s0;C0 &]
[s0; [C0     connect( listView, SIGNAL( clicked( QListViewItem`* ) 
), this, SLOT( itemSelected( QListViewItem`* ) ) );]&]
[s0;C0 &]
[s0; [C0     mainGrid`->addWidget( listView, 1, 0 );]&]
[s0; [C0     listView`->setAllColumnsShowFocus( TRUE );]&]
[s0; [C0 `}]&]
[s0;C0 &]
[s0; [C0 void ABCentralWidget`::save( const QString `&filename )]&]
[s0; [C0 `{]&]
[s0; [C0     if ( !listView`->firstChild() )]&]
[s0; [C0         return;]&]
[s0;C0 &]
[s0; [C0     QFile f( filename );]&]
[s0; [C0     if ( !f.open( IO`_WriteOnly ) )]&]
[s0; [C0         return;]&]
[s0;C0 &]
[s0; [C0     QTextStream t( `&f );]&]
[s0;C0 &]
[s0; [C0     QListViewItemIterator it( listView );]&]
[s0;C0 &]
[s0; [C0     for ( ; it.current(); `+`+it )]&]
[s0; [C0         for ( unsigned int i `= 0; i < 4; i`+`+ )]&]
[s0; [C0             t << it.current()`->text( i ) << `"n`";]&]
[s0;C0 &]
[s0; [C0     f.close();]&]
[s0; [C0 `}]&]
[s0;C0 &]
[s0; [C0 void ABCentralWidget`::load( const QString `&filename )]&]
[s0; [C0 `{]&]
[s0; [C0     listView`->clear();]&]
[s0;C0 &]
[s0; [C0     QFile f( filename );]&]
[s0; [C0     if ( !f.open( IO`_ReadOnly ) )]&]
[s0; [C0         return;]&]
[s0;C0 &]
[s0; [C0     QTextStream t( `&f );]&]
[s0;C0 &]
[s0; [C0     while ( !t.atEnd() ) `{]&]
[s0; [C0         QListViewItem `*item `= new QListViewItem( listView 
);]&]
[s0; [C0         for ( unsigned int i `= 0; i < 4; i`+`+ )]&]
[s0; [C0             item`->setText( i, t.readLine() );]&]
[s0; [C0     `}]&]
[s0;C0 &]
[s0; [C0     f.close();]&]
[s0; [C0 `}]&]
[s0;C0 &]
[s0; [C0 void ABCentralWidget`::addEntry()]&]
[s0; [C0 `{]&]
[s0; [C0     if ( !iFirstName`->text().isEmpty() `|`| !iLastName`->text().isEmpty() 
`|`|]&]
[s0; [C0          !iAddress`->text().isEmpty() `|`| !iEMail`->text().isEmpty() 
) `{]&]
[s0; [C0         QListViewItem `*item `= new QListViewItem( listView 
);]&]
[s0; [C0         item`->setText( 0, iFirstName`->text() );]&]
[s0; [C0         item`->setText( 1, iLastName`->text() );]&]
[s0; [C0         item`->setText( 2, iAddress`->text() );]&]
[s0; [C0         item`->setText( 3, iEMail`->text() );]&]
[s0; [C0     `}]&]
[s0;C0 &]
[s0; [C0     iFirstName`->setText( `"`" );]&]
[s0; [C0     iLastName`->setText( `"`" );]&]
[s0; [C0     iAddress`->setText( `"`" );]&]
[s0; [C0     iEMail`->setText( `"`" );]&]
[s0; [C0 `}]&]
[s0;C0 &]
[s0; [C0 void ABCentralWidget`::changeEntry()]&]
[s0; [C0 `{]&]
[s0; [C0     QListViewItem `*item `= listView`->currentItem();]&]
[s0;C0 &]
[s0; [C0     if ( item `&`&]&]
[s0; [C0          ( !iFirstName`->text().isEmpty() `|`| !iLastName`->text().isEmpty() 
`|`|]&]
[s0; [C0            !iAddress`->text().isEmpty() `|`| !iEMail`->text().isEmpty() 
) ) `{]&]
[s0; [C0         item`->setText( 0, iFirstName`->text() );]&]
[s0; [C0         item`->setText( 1, iLastName`->text() );]&]
[s0; [C0         item`->setText( 2, iAddress`->text() );]&]
[s0; [C0         item`->setText( 3, iEMail`->text() );]&]
[s0; [C0     `}]&]
[s0; [C0 `}]&]
[s0;C0 &]
[s0; [C0 void ABCentralWidget`::selectionChanged()]&]
[s0; [C0 `{]&]
[s0; [C0     iFirstName`->setText( `"`" );]&]
[s0; [C0     iLastName`->setText( `"`" );]&]
[s0; [C0     iAddress`->setText( `"`" );]&]
[s0; [C0     iEMail`->setText( `"`" );]&]
[s0; [C0 `}]&]
[s0;C0 &]
[s0; [C0 void ABCentralWidget`::itemSelected( QListViewItem `*item )]&]
[s0; [C0 `{]&]
[s0; [C0     if ( !item )]&]
[s0; [C0         return;]&]
[s0; [C0     item`->setSelected( TRUE );]&]
[s0; [C0     item`->repaint();]&]
[s0;C0 &]
[s0; [C0     iFirstName`->setText( item`->text( 0 ) );]&]
[s0; [C0     iLastName`->setText( item`->text( 1 ) );]&]
[s0; [C0     iAddress`->setText( item`->text( 2 ) );]&]
[s0; [C0     iEMail`->setText( item`->text( 3 ) );]&]
[s0; [C0 `}]&]
[s0;C0 &]
[s0; [C0 void ABCentralWidget`::toggleFirstName()]&]
[s0; [C0 `{]&]
[s0; [C0     sFirstName`->setText( `"`" );]&]
[s0;C0 &]
[s0; [C0     if ( cFirstName`->isChecked() ) `{]&]
[s0; [C0         sFirstName`->setEnabled( TRUE );]&]
[s0; [C0         sFirstName`->setFocus();]&]
[s0; [C0     `}]&]
[s0; [C0     else]&]
[s0; [C0         sFirstName`->setEnabled( FALSE );]&]
[s0; [C0 `}]&]
[s0;C0 &]
[s0; [C0 void ABCentralWidget`::toggleLastName()]&]
[s0; [C0 `{]&]
[s0; [C0     sLastName`->setText( `"`" );]&]
[s0;C0 &]
[s0; [C0     if ( cLastName`->isChecked() ) `{]&]
[s0; [C0         sLastName`->setEnabled( TRUE );]&]
[s0; [C0         sLastName`->setFocus();]&]
[s0; [C0     `}]&]
[s0; [C0     else]&]
[s0; [C0         sLastName`->setEnabled( FALSE );]&]
[s0; [C0 `}]&]
[s0;C0 &]
[s0; [C0 void ABCentralWidget`::toggleAddress()]&]
[s0; [C0 `{]&]
[s0; [C0     sAddress`->setText( `"`" );]&]
[s0;C0 &]
[s0; [C0     if ( cAddress`->isChecked() ) `{]&]
[s0; [C0         sAddress`->setEnabled( TRUE );]&]
[s0; [C0         sAddress`->setFocus();]&]
[s0; [C0     `}]&]
[s0; [C0     else]&]
[s0; [C0         sAddress`->setEnabled( FALSE );]&]
[s0; [C0 `}]&]
[s0;C0 &]
[s0; [C0 void ABCentralWidget`::toggleEMail()]&]
[s0; [C0 `{]&]
[s0; [C0     sEMail`->setText( `"`" );]&]
[s0;C0 &]
[s0; [C0     if ( cEMail`->isChecked() ) `{]&]
[s0; [C0         sEMail`->setEnabled( TRUE );]&]
[s0; [C0         sEMail`->setFocus();]&]
[s0; [C0     `}]&]
[s0; [C0     else]&]
[s0; [C0         sEMail`->setEnabled( FALSE );]&]
[s0; [C0 `}]&]
[s0;C0 &]
[s0; [C0 void ABCentralWidget`::findEntries()]&]
[s0; [C0 `{]&]
[s0; [C0     if ( !cFirstName`->isChecked() `&`&]&]
[s0; [C0          !cLastName`->isChecked() `&`&]&]
[s0; [C0          !cAddress`->isChecked() `&`&]&]
[s0; [C0          !cEMail`->isChecked() ) `{]&]
[s0; [C0         listView`->clearSelection();]&]
[s0; [C0         return;]&]
[s0; [C0     `}]&]
[s0;C0 &]
[s0; [C0     QListViewItemIterator it( listView );]&]
[s0;C0 &]
[s0; [C0     for ( ; it.current(); `+`+it ) `{]&]
[s0; [C0         bool select `= TRUE;]&]
[s0;C0 &]
[s0; [C0         if ( cFirstName`->isChecked() ) `{]&]
[s0; [C0             if ( select `&`& it.current()`->text( 0 ).contains( 
sFirstName`->text() ) )]&]
[s0; [C0                 select `= TRUE;]&]
[s0; [C0             else]&]
[s0; [C0                 select `= FALSE;]&]
[s0; [C0         `}]&]
[s0; [C0         if ( cLastName`->isChecked() ) `{]&]
[s0; [C0             if ( select `&`& it.current()`->text( 1 ).contains( 
sLastName`->text() ) )]&]
[s0; [C0                 select `= TRUE;]&]
[s0; [C0             else]&]
[s0; [C0                 select `= FALSE;]&]
[s0; [C0         `}]&]
[s0; [C0         if ( cAddress`->isChecked() ) `{]&]
[s0; [C0             if ( select `&`& it.current()`->text( 2 ).contains( 
sAddress`->text() ) )]&]
[s0; [C0                 select `= TRUE;]&]
[s0; [C0             else]&]
[s0; [C0                 select `= FALSE;]&]
[s0; [C0         `}]&]
[s0; [C0         if ( cEMail`->isChecked() ) `{]&]
[s0; [C0             if ( select `&`& it.current()`->text( 3 ).contains( 
sEMail`->text() ) )]&]
[s0; [C0                 select `= TRUE;]&]
[s0; [C0             else]&]
[s0; [C0                 select `= FALSE;]&]
[s0; [C0         `}]&]
[s0;C0 &]
[s0; [C0         if ( select )]&]
[s0; [C0             it.current()`->setSelected( TRUE );]&]
[s0; [C0         else]&]
[s0; [C0             it.current()`->setSelected( FALSE );]&]
[s0; [C0         it.current()`->repaint();]&]
[s0; [C0     `}]&]
[s0; [C0 `}]&]
[s0;C0 &]
[s0; [*C2 main.cpp]&]
[s0;C0 &]
[s0; [C0 #include <qapplication.h>]&]
[s0;C0 &]
[s0; [C0 #include `"mainwindow.h`"]&]
[s0;C0 &]
[s0; [C0 int main( int argc, char `*`* argv )]&]
[s0; [C0 `{]&]
[s0; [C0     QApplication a( argc, argv );]&]
[s0;C0 &]
[s0; [C0     ABMainWindow `*mw `= new ABMainWindow();]&]
[s0; [C0     mw`->setCaption( `"Qt Example `- Addressbook`" );]&]
[s0; [C0     a.setMainWidget( mw );]&]
[s0; [C0     mw`->show();]&]
[s0;C0 &]
[s0; [C0     a.connect( `&a, SIGNAL( lastWindowClosed() ), `&a, SLOT( 
quit() ) );]&]
[s0; [C0     int result `= a.exec();]&]
[s0; [C0     delete mw;]&]
[s0; [C0     return result;]&]
[s0; [C0 `}]&]
[s0;=2 ]}}&]
[s0;=2 &]
[ {{5000:5000@(255.255.200)-1 [s0; [/2 To make this comparison more fair, we have omitted following 
parts that are designed by layout designer in Ultimate`+`+ and 
could be designed by Qt designer]]
::@2 [s0;%- ]
::^@7 [s0; [*2 Ultimate`+`+ version]]
:: [s0; [*2 Qt version]]
::@2 [s0; [*C2 AddressBook.lay]&]
[s0; [/C2 (designed using layout designer)]&]
[s0;/C2 &]
[s0; [C0 #ifdef LAYOUTFILE]&]
[s0;C0 &]
[s0; [C0 LAYOUT(AddressBookLayout, 496, 456)]&]
[s0; [C0 -|ITEM(MenuBar, menu, LeftPosZ(0, 200).TopPosZ(0, 20))]&]
[s0; [C0 -|ITEM(TabCtrl, tab, LeftPosZ(8, 480).TopPosZ(32, 84))]&]
[s0; [C0 -|ITEM(ArrayCtrl, array, LeftPosZ(8, 480).TopPosZ(124, 324))]&]
[s0; [C0 END`_LAYOUT]&]
[s0;C0 &]
[s0; [C0 LAYOUT(ModifyLayout, 480, 52)]&]
[s0; [C0 -|ITEM(Label, dv`_`_`_0, SetLabel(`"`&Name`").LeftPosZ(8, 48).TopPosZ(8, 
15))]&]
[s0; [C0 -|ITEM(EditField, name, LeftPosZ(8, 96).TopPosZ(28, 19))]&]
[s0; [C0 -|ITEM(Label, dv`_`_`_2, SetLabel(`"`&Surname`").LeftPosZ(108, 
48).TopPosZ(8, 15))]&]
[s0; [C0 -|ITEM(EditField, surname, LeftPosZ(108, 96).TopPosZ(28, 19))]&]
[s0; [C0 -|ITEM(Label, dv`_`_`_4, SetLabel(`"`&Address`").LeftPosZ(208, 
48).TopPosZ(8, 15))]&]
[s0; [C0 -|ITEM(EditField, address, LeftPosZ(208, 96).TopPosZ(28, 19))]&]
[s0; [C0 -|ITEM(Label, dv`_`_`_6, SetLabel(`"`&Email`").LeftPosZ(308, 
48).TopPosZ(8, 15))]&]
[s0; [C0 -|ITEM(EditField, email, LeftPosZ(308, 96).TopPosZ(28, 19))]&]
[s0; [C0 -|ITEM(Button, add, SetLabel(`"Ad`&d`").LeftPosZ(416, 56).TopPosZ(4, 
20))]&]
[s0; [C0 -|ITEM(Button, change, SetLabel(`"`&Change`").LeftPosZ(416, 
56).TopPosZ(28, 20))]&]
[s0; [C0 END`_LAYOUT]&]
[s0;C0 &]
[s0; [C0 LAYOUT(SearchLayout, 480, 56)]&]
[s0; [C0 -|ITEM(Option, oname, SetLabel(`"`&Name`").LeftPosZ(8, 56).TopPosZ(8, 
18))]&]
[s0; [C0 -|ITEM(EditField, name, LeftPosZ(8, 96).TopPosZ(28, 19))]&]
[s0; [C0 -|ITEM(Option, osurname, SetLabel(`"`&Surname`").LeftPosZ(108, 
64).TopPosZ(8, 18))]&]
[s0; [C0 -|ITEM(EditField, surname, LeftPosZ(108, 96).TopPosZ(28, 19))]&]
[s0; [C0 -|ITEM(Option, oaddress, SetLabel(`"`&Address`").LeftPosZ(208, 
64).TopPosZ(8, 18))]&]
[s0; [C0 -|ITEM(EditField, address, LeftPosZ(208, 96).TopPosZ(28, 19))]&]
[s0; [C0 -|ITEM(Option, oemail, SetLabel(`"`&Email`").LeftPosZ(308, 
52).TopPosZ(8, 18))]&]
[s0; [C0 -|ITEM(EditField, email, LeftPosZ(308, 96).TopPosZ(28, 19))]&]
[s0; [C0 -|ITEM(Button, search, SetLabel(`"`&Search`").LeftPosZ(416, 
56).TopPosZ(28, 20))]&]
[s0; [C0 END`_LAYOUT]&]
[s0;C0 &]
[s0; [C0 #endif]]
:: [s0; [C0 void ABCentralWidget`::setupTabWidget()]&]
[s0; [C0 `{]&]
[s0; [C0     tabWidget `= new QTabWidget( this );]&]
[s0;C0 &]
[s0; [C0     QWidget `*input `= new QWidget( tabWidget );]&]
[s0; [C0     QGridLayout `*grid1 `= new QGridLayout( input, 2, 5, 5, 
5 );]&]
[s0;C0 &]
[s0; [C0     QLabel `*liFirstName `= new QLabel( `"First `&Name`", 
input );]&]
[s0; [C0     liFirstName`->resize( liFirstName`->sizeHint() );]&]
[s0; [C0     grid1`->addWidget( liFirstName, 0, 0 );]&]
[s0;C0 &]
[s0; [C0     QLabel `*liLastName `= new QLabel( `"`&Last Name`", input 
);]&]
[s0; [C0     liLastName`->resize( liLastName`->sizeHint() );]&]
[s0; [C0     grid1`->addWidget( liLastName, 0, 1 );]&]
[s0;C0 &]
[s0; [C0     QLabel `*liAddress `= new QLabel( `"Add`&ress`", input 
);]&]
[s0; [C0     liAddress`->resize( liAddress`->sizeHint() );]&]
[s0; [C0     grid1`->addWidget( liAddress, 0, 2 );]&]
[s0;C0 &]
[s0; [C0     QLabel `*liEMail `= new QLabel( `"`&E`-Mail`", input );]&]
[s0; [C0     liEMail`->resize( liEMail`->sizeHint() );]&]
[s0; [C0     grid1`->addWidget( liEMail, 0, 3 );]&]
[s0;C0 &]
[s0; [C0     add `= new QPushButton( `"A`&dd`", input );]&]
[s0; [C0     add`->resize( add`->sizeHint() );]&]
[s0; [C0     grid1`->addWidget( add, 0, 4 );]&]
[s0; [C0     connect( add, SIGNAL( clicked() ), this, SLOT( addEntry() 
) );]&]
[s0;C0 &]
[s0; [C0     iFirstName `= new QLineEdit( input );]&]
[s0; [C0     iFirstName`->resize( iFirstName`->sizeHint() );]&]
[s0; [C0     grid1`->addWidget( iFirstName, 1, 0 );]&]
[s0; [C0     liFirstName`->setBuddy( iFirstName );]&]
[s0;C0 &]
[s0; [C0     iLastName `= new QLineEdit( input );]&]
[s0; [C0     iLastName`->resize( iLastName`->sizeHint() );]&]
[s0; [C0     grid1`->addWidget( iLastName, 1, 1 );]&]
[s0; [C0     liLastName`->setBuddy( iLastName );]&]
[s0;C0 &]
[s0; [C0     iAddress `= new QLineEdit( input );]&]
[s0; [C0     iAddress`->resize( iAddress`->sizeHint() );]&]
[s0; [C0     grid1`->addWidget( iAddress, 1, 2 );]&]
[s0; [C0     liAddress`->setBuddy( iAddress );]&]
[s0;C0 &]
[s0; [C0     iEMail `= new QLineEdit( input );]&]
[s0; [C0     iEMail`->resize( iEMail`->sizeHint() );]&]
[s0; [C0     grid1`->addWidget( iEMail, 1, 3 );]&]
[s0; [C0     liEMail`->setBuddy( iEMail );]&]
[s0;C0 &]
[s0; [C0     change `= new QPushButton( `"`&Change`", input );]&]
[s0; [C0     change`->resize( change`->sizeHint() );]&]
[s0; [C0     grid1`->addWidget( change, 1, 4 );]&]
[s0; [C0     connect( change, SIGNAL( clicked() ), this, SLOT( changeEntry() 
) );]&]
[s0;C0 &]
[s0; [C0     tabWidget`->addTab( input, `"`&Add/Change Entry`" );]&]
[s0;C0 &]
[s0; [C0     // `-`-`-`-`-`-`-`-`-`-`-`-`-`-`-`-`-`-`-`-`-`-`-`-`-`-`-`-`-`-`-`-`-`-`-`-
`-`-]&]
[s0;C0 &]
[s0; [C0     QWidget `*search `= new QWidget( this );]&]
[s0; [C0     QGridLayout `*grid2 `= new QGridLayout( search, 2, 5, 
5, 5 );]&]
[s0;C0 &]
[s0; [C0     cFirstName `= new QCheckBox( `"First `&Name`", search 
);]&]
[s0; [C0     cFirstName`->resize( cFirstName`->sizeHint() );]&]
[s0; [C0     grid2`->addWidget( cFirstName, 0, 0 );]&]
[s0; [C0     connect( cFirstName, SIGNAL( clicked() ), this, SLOT( 
toggleFirstName() ) );]&]
[s0;C0 &]
[s0; [C0     cLastName `= new QCheckBox( `"`&Last Name`", search );]&]
[s0; [C0     cLastName`->resize( cLastName`->sizeHint() );]&]
[s0; [C0     grid2`->addWidget( cLastName, 0, 1 );]&]
[s0; [C0     connect( cLastName, SIGNAL( clicked() ), this, SLOT( toggleLastName() 
) );]&]
[s0;C0 &]
[s0; [C0     cAddress `= new QCheckBox( `"Add`&ress`", search );]&]
[s0; [C0     cAddress`->resize( cAddress`->sizeHint() );]&]
[s0; [C0     grid2`->addWidget( cAddress, 0, 2 );]&]
[s0; [C0     connect( cAddress, SIGNAL( clicked() ), this, SLOT( toggleAddress() 
) );]&]
[s0;C0 &]
[s0; [C0     cEMail `= new QCheckBox( `"`&E`-Mail`", search );]&]
[s0; [C0     cEMail`->resize( cEMail`->sizeHint() );]&]
[s0; [C0     grid2`->addWidget( cEMail, 0, 3 );]&]
[s0; [C0     connect( cEMail, SIGNAL( clicked() ), this, SLOT( toggleEMail() 
) );]&]
[s0;C0 &]
[s0; [C0     sFirstName `= new QLineEdit( search );]&]
[s0; [C0     sFirstName`->resize( sFirstName`->sizeHint() );]&]
[s0; [C0     grid2`->addWidget( sFirstName, 1, 0 );]&]
[s0;C0 &]
[s0; [C0     sLastName `= new QLineEdit( search );]&]
[s0; [C0     sLastName`->resize( sLastName`->sizeHint() );]&]
[s0; [C0     grid2`->addWidget( sLastName, 1, 1 );]&]
[s0;C0 &]
[s0; [C0     sAddress `= new QLineEdit( search );]&]
[s0; [C0     sAddress`->resize( sAddress`->sizeHint() );]&]
[s0; [C0     grid2`->addWidget( sAddress, 1, 2 );]&]
[s0;C0 &]
[s0; [C0     sEMail `= new QLineEdit( search );]&]
[s0; [C0     sEMail`->resize( sEMail`->sizeHint() );]&]
[s0; [C0     grid2`->addWidget( sEMail, 1, 3 );]&]
[s0;C0 &]
[s0; [C0     find `= new QPushButton( `"F`&ind`", search );]&]
[s0; [C0     find`->resize( find`->sizeHint() );]&]
[s0; [C0     grid2`->addWidget( find, 1, 4 );]&]
[s0; [C0     connect( find, SIGNAL( clicked() ), this, SLOT( findEntries() 
) );]&]
[s0;C0 &]
[s0; [C0     cFirstName`->setChecked( TRUE );]&]
[s0; [C0     sFirstName`->setEnabled( TRUE );]&]
[s0; [C0     sLastName`->setEnabled( FALSE );]&]
[s0; [C0     sAddress`->setEnabled( FALSE );]&]
[s0; [C0     sEMail`->setEnabled( FALSE );]&]
[s0;C0 &]
[s0; [C0     tabWidget`->addTab( search, `"`&Search`" );]&]
[s0;C0 &]
[s0; [C0     mainGrid`->addWidget( tabWidget, 0, 0 );]&]
[s0; [C0 `}]&]
[s0;C0 ]}}&]
[s0;=2 &]
[s0; ]]